import { Controller, Post, Body } from '@nestjs/common';
import { WeatherService } from './weather.service';
import { ApiOperation, ApiTags } from '@nestjs/swagger/dist';
import { GetWeatherDto } from './dto/get-weather.dto';

@Controller('weather')
@ApiTags('Weather 天气')
export class WeatherController {
  constructor(private readonly weatherService: WeatherService) {}

  @Post('getWeather')
  @ApiOperation({
    summary:
      '查询指定城市天气(调用高德地图天气API接口 https://lbs.amap.com/api/webservice/guide/api/weatherinfo)',
  })
  getWeather(@Body() getWeatherDto: GetWeatherDto) {
    return this.weatherService.getWeather(getWeatherDto);
  }
}
